/**
 * @description 定义业务路由--动态加载，也叫懒加载
 */
// import Home from '../views/home'

import store from '@/store'

// ES6模块化引入机制
// const Home = () => import(/** webpackChunkName: "Home" */'../views/home')
// const SupplierEdit = () => import(/** webpackChunkName: "SupplierEdit" */'../views/purchase/supplier/edit')

// const arr = [
//     {path: '/home'},
//     {path: '/purchase/supplier/edit'}
// ]




// const routes = [
//     {path: '/home', component: Home},
//     {path: '/purchase/supplier/edit', component: SupplierEdit}
// ]
// const routes = [
//     {path: '/home', component: (() => import('../views/home'))},
//     {path: '/purchase/supplier/edit', component: (() => import('../views/purchase/supplier/edit'))}
// ]

let menuList = store.getters['common/menuList'].filter(it => !!it.path)
let routes = menuList.map(it => ({path: it.path, component: (() => import('../views' + it.path))}) )

export default routes